/**
 * HTTP请求拦截器演示页面样式
 * @description 提供HTTP请求拦截器演示页面的样式定义
 * @author 系统管理员
 * @version 1.0.0
 * @date 2024-01-15
 */

// ==================== 页面布局样式 ====================

.http-interceptor-demo {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  .demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
  }
  
  .demo-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
}

// ==================== 标题和描述样式 ====================

.demo-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.demo-description {
  font-size: 1.1rem;
  text-align: center;
  color: #666;
  margin-bottom: 40px;
  line-height: 1.6;
}

// ==================== 演示区域样式 ====================

.demo-sections {
  display: grid;
  gap: 30px;
  margin-bottom: 40px;
}

.demo-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }
  
  .section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    
    &::before {
      content: '';
      width: 4px;
      height: 20px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      margin-right: 12px;
      border-radius: 2px;
    }
  }
}

// ==================== 按钮组样式 ====================

.demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  
  .el-button {
    min-width: 120px;
    height: 40px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    &.is-loading {
      pointer-events: none;
    }
  }
}

// ==================== 表单样式 ====================

.demo-form {
  .el-form {
    .el-form-item {
      margin-bottom: 20px;
      
      .el-form-item__label {
        font-weight: 500;
        color: #333;
      }
      
      .el-input,
      .el-select,
      .el-input-number {
        .el-input__wrapper {
          border-radius: 8px;
          border: 1px solid #dcdfe6;
          transition: all 0.3s ease;
          
          &:hover {
            border-color: #c0c4cc;
          }
          
          &.is-focus {
            border-color: #409eff;
            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
          }
        }
      }
      
      .el-textarea {
        .el-textarea__inner {
          border-radius: 8px;
          border: 1px solid #dcdfe6;
          transition: all 0.3s ease;
          
          &:hover {
            border-color: #c0c4cc;
          }
          
          &:focus {
            border-color: #409eff;
            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
          }
        }
      }
      
      .el-switch {
        .el-switch__core {
          border-radius: 12px;
        }
      }
    }
  }
}

// ==================== 响应展示样式 ====================

.response-display {
  .el-tabs {
    .el-tabs__header {
      margin-bottom: 0;
      
      .el-tabs__nav-wrap {
        .el-tabs__nav {
          .el-tabs__item {
            border-radius: 8px 8px 0 0;
            font-weight: 500;
            
            &.is-active {
              background: #409eff;
              color: white;
            }
          }
        }
      }
    }
    
    .el-tabs__content {
      .el-tab-pane {
        padding: 20px;
        background: #f8f9fa;
        border-radius: 0 0 8px 8px;
        min-height: 300px;
      }
    }
  }
}

// ==================== 响应内容样式 ====================

.response-content,
.error-content {
  background: #2d3748;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
  
  &::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  &::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
    
    &:hover {
      background: #718096;
    }
  }
}

.error-content {
  background: #742a2a;
  color: #fed7d7;
}

// ==================== 日志内容样式 ====================

.log-content {
  max-height: 400px;
  overflow-y: auto;
  
  .log-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    
    .log-time {
      color: #718096;
      margin-right: 12px;
      min-width: 80px;
    }
    
    .log-message {
      flex: 1;
      word-break: break-word;
    }
    
    // 日志类型样式
    &.info {
      background: #ebf8ff;
      color: #2b6cb0;
      border-left: 3px solid #3182ce;
    }
    
    &.success {
      background: #f0fff4;
      color: #2f855a;
      border-left: 3px solid #38a169;
    }
    
    &.warning {
      background: #fffbeb;
      color: #c05621;
      border-left: 3px solid #ed8936;
    }
    
    &.error {
      background: #fed7d7;
      color: #c53030;
      border-left: 3px solid #e53e3e;
    }
  }
  
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    
    &:hover {
      background: #a8a8a8;
    }
  }
}

// ==================== 响应式设计 ====================

@media (max-width: 768px) {
  .http-interceptor-demo {
    .demo-container {
      padding: 20px 15px;
    }
    
    .demo-card {
      padding: 25px 20px;
    }
    
    .demo-title {
      font-size: 2rem;
    }
    
    .demo-description {
      font-size: 1rem;
    }
    
    .demo-buttons {
      flex-direction: column;
      
      .el-button {
        width: 100%;
        min-width: auto;
      }
    }
    
    .demo-form {
      .el-form {
        .el-form-item {
          .el-form-item__label {
            text-align: left;
            margin-bottom: 8px;
          }
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .http-interceptor-demo {
    .demo-container {
      padding: 15px 10px;
    }
    
    .demo-card {
      padding: 20px 15px;
    }
    
    .demo-title {
      font-size: 1.8rem;
    }
    
    .demo-section {
      padding: 20px 15px;
      
      .section-title {
        font-size: 1.2rem;
      }
    }
    
    .response-content,
    .error-content {
      font-size: 12px;
      padding: 15px;
    }
  }
}
